<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: zhangjx
 * @Date: 2023-05-23 11:06:40
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2023-11-28 13:48:25
-->
<script setup lang="ts">
import DevicePixelRatio from '@/utils/evicePixelRatio';
import { RouterView } from 'vue-router'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import apiMod from '@/apiMod'
import { useUserStore } from '@/stores/user'
import { useCommonStore } from '@/stores/common'
const {  resfreshUserAuth } = useUserStore()
const {  setInitMqtt } = useCommonStore()
const isRouterAlive = ref(true)
const reload: any = () => {
  resfreshUserAuth()
  isRouterAlive.value = false
  nextTick(() => {
    isRouterAlive.value = true
  })
}
provide('apiMod', apiMod)
provide('reload', reload)

onMounted(()=> {
  new DevicePixelRatio().init();
  setInitMqtt()
})
</script>

<template>
  <el-config-provider :locale="zhCn">
    <RouterView v-if="isRouterAlive" />
  </el-config-provider>
</template>

<style scoped></style>
